package com.huwei.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import com.huwei.controller.valid.PasswordValid;
import com.huwei.controller.valid.PhoneValid;
import com.huwei.controller.valid.UsernameValid;

import lombok.Data;

@Data
@Entity
@Table(name="user_account")
public class UserAccount {
	@Id
	@GeneratedValue
	private Long id;
	@NotNull(message="{prompt.username.null}" ,groups= {UsernameValid.class})
	private String username;
	@Pattern(regexp="^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$" ,message="{prompt.phone.format}",groups= {PhoneValid.class})
	private String phone;
	@NotNull(message="{prompt.password.null}" ,groups= {PasswordValid.class})
	private String password;
	@Column(name="register_ipv4")
	private String registerIpv4;
	@Column(name="register_ipv6")
	private String registerIpv6;
	@Column(name="register_time")
	private Date registerTime;
	@Column(name="last_login_time")
	private Date lastLoginTime;
	@Column(name="last_login_ipv4")
	private String lastLoginIpv4;
	@Column(name="last_login_ipv6")
	private String lastLoginIpv6;
	private String uuid;
	private Integer status;
	@Column(name="status_modifier")
	private String statusModifier;
	@Column(name="status_modify_time")
	private Date statusModifyTime;
	@Column(name="status_modify_info")
	private String statusModifyInfo;
}
